<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>获取变量的数据类型</title>
    <script>
        var num = 10;
        console.log(typeof num);  // number
        var str = 'curry';
        console.log(typeof str);  // string
        var flag = true;
        console.log(typeof flag);  // blooean
        var vari = undefined;
        console.log(typeof vari);  // undefined
        var timer = null;
        console.log(typeof null); // object
        // prompt取过来的值是字符串型的
        var age = prompt('请输入你的年龄: ');
        console.log(age);
        console.log(typeof age);
        
        
        
        
        
        
    </script>
</head>
<body>
    
</body>
</html>